﻿using System;
using System.Collections.Generic;
using System.Text;
using Abp.Dependency;
using Abp.Events.Bus.Entities;
using Abp.Events.Bus.Handlers;
using Abp.RemoteEventBus;
using Abp.Runtime.Caching;
using FwProject.Car;
using FwProject.Comm;

namespace FwProject.EventHandle
{
    public class CarMapHandle : IEventHandler<EntityChangedEventData<CarMap>>, ITransientDependency
    {
        public readonly ICacheManager _catchmanager;
        public IRemoteEventBus remoteEventBus { get; set; }//缓存对象
        public CarMapHandle(ICacheManager catchmanager)
        {
            _catchmanager = catchmanager;
            remoteEventBus = NullRemoteEventBus.Instance;

        }
        /// <summary>
        /// 删除缓存
        /// </summary>
        /// <param name="eventData">Event data.</param>
        public void HandleEvent(EntityChangedEventData<CarMap> eventData)
        {
            //ICache cache = _catchmanager.GetCache(nameof(CarMap));
            //cache.Remove("list");
            //var catcheventDate = new RemoteEventData(RemoteTypeHelp.TypeModelCatch)
            //{
            //    Data = { [RemoteTypeHelp.Model] = nameof(CarMap) }
            //};
            //remoteEventBus.Publish(RemoteTypeHelp.TopicSystemCatch, catcheventDate);
        }

    }
}
